package hbot;

import java.util.ArrayList;

import hbot.User32Access.User32AccessException;
import hbot.User32Access.WindowNotFoundException;

import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import com.atul.JavaOpenCV.Imshow;


public class Main {
	 public static void main(String[] args) throws WindowNotFoundException, User32AccessException {
	        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

	        // temporary use image read for testing
			//ScreenReader reader = new ScreenReader();
			//Mat screencapture = reader.getHearthstoneWindow();
			
	        Mat screencapture = Highgui.imread("images/3minion.png");
	        
	        RegionsReader rReader = new RegionsReader();
	        
	        ArrayList<Rect> oddRegions = rReader.getOddRegions(screencapture);
	        
	        for (Rect region: oddRegions){
	        	Core.rectangle(screencapture, 
	        			new Point(region.x,region.y), 
	        			new Point(region.x + region.width,region.y + region.height), 
	        			new Scalar(0,0,255), 
	        			2);
	        }
	        
	        //Core.circle(src, new Point(1,2), 5, new Scalar(0,0,255),2);
	        
			Imshow show_image = new Imshow("Output");
			show_image.showImage(screencapture);
	        
	        
	      
	    }
	 

}
